# Maintainer: American_Jesus <american.jesus.pt AT gmail DOT com>

_pkgname=nano-syntax-highlighting
pkgname=${_pkgname}-git
pkgver=299.5e776df
pkgrel=1
pkgdesc="Nano editor syntax highlighting enhancements"
arch=('any')
depends=('nano')
makedepends=('git')
url="https://github.com/scopatz/nanorc"
license=('custom')
install=nano-syntax-highlighting.install
provides=('nano-syntax-highlighting')
conflicts=('nano-syntax-highlighting')
source=('nanorc::git+https://github.com/scopatz/nanorc.git#branch=master'
        'nanorc.sample')
sha256sums=('SKIP'
            '173e76e537261fc3633954e4ad4f807576f7cf2fc82edfdae205a721021bc805')

pkgver() {
  cd ${srcdir}/nanorc
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd ${srcdir}

  mkdir -p ${pkgdir}/usr/share/${_pkgname}

  find ${srcdir}/nanorc/ -name '*.nanorc' | xargs install -D -m644 -t ${pkgdir}/usr/share/${_pkgname}/

  install -D -m644 ${srcdir}/nanorc.sample ${pkgdir}/usr/share/${_pkgname}/nanorc.sample
}
